<template>
	<view>
		<view class="uni-margin-wrap">
			<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="5000" :duration="500">
				<swiper-item  v-for="item in ['A','B','C']" :key="item">
					<view class="swiper-item">
						<image :src="'/static/image/menu-swiper/'+ item + '.png'">
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="menu-wrap">
			<view class="main-menu">
				<view class="content">
					<view class="main-core" v-if="isStudent">
						<view class="main-core-item" v-for="(item,index) in s_menu" :key="index">
							<view @click="jumpTo(item.path)">
								<image class="core-item-icon" :src="item.icon"></image>
								<text class="core-item-name">{{item.text}}</text>
							</view>
						</view>
					</view>
					<view class="main-core" v-else>
						<view class="main-core-item" v-for="(item,index) in t_menu" :key="index">
							<view @click="jumpTo(item.path)">
								<image class="core-item-icon" :src="item.icon"></image>
								<text class="core-item-name">{{item.text}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="submenu">
				<view class="submenu-item" v-for="(item,index) in submenu" @click="jumpTo(item.path)" :key="index">
					<image class="submenu-item-icon" :src="item.icon"></image>
					<text class="submenu-item-name">{{item.text}}</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				isStudent: false,
				s_menu: [{
						text: '学籍信息',
						icon: '../../static/image/menu-item/studentStatusInformation.png',
						path: '../student/studentStatusInformation'
					},
					{
						text: '培养计划',
						icon: '../../static/image/menu-item/trainingPlan.png',
						path: '../student/trainingPlan'
					},
					{
						text: '成绩查看',
						icon: '../../static/image/menu-item/score.png',
						path: '../student/score'
					},
					{
						text: '学籍变更',
						icon: '../../static/image/menu-item/checkStudyStateChange.png',
						path: '../student/checkStudyStateChange'
					},
					{
						text: '公派申请',
						icon: '../../static/image/menu-item/checkAbroadProject.png',
						path: '../student/checkAbroadProject'
					},
					{
						text: '国际会议',
						icon: '../../static/image/menu-item/checkInternationalMeeting.png',
						path: '../student/checkInternationalMeeting'
					},
					{
						text: '出国申请',
						icon: '../../static/image/menu-item/checkAbroadApply.png',
						path: '../student/checkAbroadApply'
					},
					{
						text: '归国变更',
						icon: '../../static/image/menu-item/checkAbroadChange.png',
						path: '../student/checkAbroadChange'
					},
					{
						text: '毕业申请',
						icon: '../../static/image/menu-item/checkAraduateApply.png',
						path: '../student/checkAraduateApply'
					},
					{
						text: '优秀成果',
						icon: '../../static/image/menu-item/checkAchievementReward.png',
						path: '../student/checkAchievementReward'
					},
				],
				t_menu: [{
						text: '论文维护',
						icon: '../../static/image/menu-item/paperMaintenance.png',
						path: '../tutor/achievement/paperMaintenance'
					},
					{
						text: '专著维护',
						icon: '../../static/image/menu-item/monographMaintenance.png',
						path: '../tutor/achievement/monographMaintenance'
					},
					{
						text: '项目维护',
						icon: '../../static/image/menu-item/projectMaintenance.png',
						path: '../tutor/achievement/projectMaintenance'
					},
					{
						text: '奖励维护',
						icon: '../../static/image/menu-item/rewardMaintenance.png',
						path: '../tutor/achievement/rewardMaintenance'
					},
					{
						text: '专利维护',
						icon: '../../static/image/menu-item/patentMaintenance.png',
						path: '../tutor/achievement/patentMaintenance'
					},
					{
						text: '招生资格',
						icon: '../../static/image/menu-item/admissionsQualification.png',
						path: '../tutor/recruit/admissionsQualification'
					},
					{
						text: '招生团队',
						icon: '../../static/image/menu-item/admissionsTeam.png',
						path: '../tutor/teamAdmission/teamApplyList'
					},
					{
						text: '毕业审核',
						icon: '../../static/image/menu-item/graduation.png',
						path: '../tutor/graduation/graduationAudit'
					},
					{
						text: '论文审核',
						icon: '../../static/image/menu-item/paperReview.png',
						path: '../tutor/graduation/paperReview'
					},
					{
						text: '外审论文',
						icon: '../../static/image/menu-item/outsideAudit.png',
						path: '../tutor/graduation/outsideAudit'
					},
					{
						text: '出国申请',
						icon: '../../static/image/menu-item/checkAbroadApply.png',
						path: '../tutor/abord/checkAbroadApply'
					},
					{
						text: '归国变更',
						icon: '../../static/image/menu-item/checkAbroadChange.png',
						path: '../tutor/abord/checkAbroadChange'
					},
					{
						text: '公派申请',
						icon: '../../static/image/menu-item/checkAbroadProject.png',
						path: '../tutor/abord/checkAbroadProject'
					},
					{
						text: '国际会议',
						icon: '../../static/image/menu-item/checkInternationalMeeting.png',
						path: '../tutor/abord/checkInternationalMeeting'
					},
					{
						text: '培养计划',
						icon: '../../static/image/menu-item/trainingPlan.png',
						path: '../tutor/trainingPlan/trainingPlan'
					},
				],
				submenu: [{
					text: '问卷',
					icon: '../../static/image/menu-item/questionnaire.png',
					path: '../questionnaire/questionnaire'
				}, {
					text: '投票',
					icon: '../../static/image/menu-item/vote.png',
					path: '../vote/voteList'
				}, {
					text: '打分',
					icon: '../../static/image/menu-item/grade.png',
					path: '../assessment/assessmentList'
				}, ]
			}
		},
		methods: {
			jumpTo(path) {
				uni.navigateTo({
					url: path
				})
			}
		},
		onLoad() {
			// this.isStudent = getApp().globalData.userType == 0;
		}
	}
</script>

<style>
	page{
		background-color: #e5e5e5;
	}
	
	.uni-margin-wrap {
		border-radius: 10px;
		overflow: hidden;
		margin: 0 10px 5px 10px;
	}

	.swiper {
		width: 100%;
	}

	.swiper-item {
		 display: flex;
		line-height: 300rpx;
		text-align: center;
		width: 100%;
	}

	.swiper-item image {
		width: 100%;
	}

	.main-menu {
		margin: 0 5% 0 5%;
		width: 90%;
	}

	.main-core {
		background-color: white;
		display: flex;
		flex-flow: row wrap;
		align-content: flex-start;
		height: 18%;
		overflow: hidden;
		padding: 0 10rpx 0 10rpx;
		border-radius: 15px;
	}

	.main-core-item {
		display: flex;
		flex-flow: column wrap;
		justify-content: center;
		align-items: center;
		box-sizing: border-box;
		width: 20%;
		height: 170upx;
	}

	.core-item-icon {
		display: block;
		width: 85upx;
		height: 85upx;
		margin: 15upx auto;
	}

	.core-item-name {
		display: block;
		font-size: 20upx;
	}

	.title {
		position: relative;
		padding-bottom: 10upx;
		text-align: center;
		background-color: #C8C7CC;
	}

	.text {
		font-weight: 500;
		font-size: 30upx;
	}

	.submenu {
		height: 100upx;
		margin: 5% 5% 0 5%;
		width: 90%;
	}

	.submenu .submenu-item {
		background-color: white;
		border-radius: 10px;
		height: 100upx;
		width: 200upx;
		margin-left: 15rpx;
		position: relative;
		padding: 5rpx;
		float: left;
	}

	.submenu .submenu-item .submenu-item-icon {
		width: 60upx;
		height: 60upx;
		float: left;
		margin-top: 20upx;
		margin-left: 10upx;
	}

	.submenu .submenu-item .submenu-item-name {
		float: left;
		font-size: 30upx;
		margin-top: 25upx;
		margin-left: 30upx;
	}
</style>
